<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Doctest Test</title></head>
<body>
<h1>Crunchy Frog Doctest Test</h1>
<p>Here's a Doctest box:</p>
<pre title="doctest">

>>> p = Animal('Pooh')
>>> p.name
'Pooh'
>>> p.addFriend('Piglet')
>>> p.friends
['Piglet']

</pre>
<p>This should generate a syntax error if using a version of Python older than 2.5:</p>
<pre>
class Animal():
    pass
</pre>
<p>This should compile but not satisfy the doctest:</p>
<pre>
class Animal:
    pass
</pre>
<p>And this should work:</p>
<pre>
class Animal:
    def __init__(self, name):
        self.name = name
        self.friends = []
    def addFriend(self, friend):
        self.friends.append(friend)
</pre>
<h2>Bugs</h2>
<ul>
  <li>There are no known bugs specific to doctests.</li>
</ul>

<p><a href="index.html">Back to the test index</a></p>
</body>
</html>